package syncagent;
import java.security.Provider.Service;

import org.osgi.service.event.Event;
import org.osgi.service.event.EventConstants;
import org.osgi.service.event.EventHandler;

public class SyncAgentEventHandler implements EventHandler {
	private SyncAgentService serviceHandle;
	
	public SyncAgentEventHandler(SyncAgentService service)
	{
		serviceHandle = service;
	}
	public void handleEvent(Event event) {
		System.out.println(String.format("# Event Handler handled event on topic '%s':"  
				                     + " Value of 'property1' = %s",  
				                     event.getProperty(EventConstants.EVENT_TOPIC),  
				                     event.getProperty("property1")));
		serviceHandle.pushEvents(event);
	}

}
